// .txt

beginzonescript;

variables;

short crime_tolerance = 200;
short last_abil;
short i;
short d_count = 0;

body;

beginstate INIT_STATE;
	set_aggression(8,9);
	set_aggression(9,9);
	
	set_name(38,"Zephyr Oasis Guard");
	set_name(39,"Zephyr Oasis Guard");
	set_name(40,"Zephyr Oasis Guard");
	set_name(41,"Zephyr Oasis Guard");

	add_range_to_group(17,23,1);
	set_name(1001,"Bridge Guard");
	set_name(17,"Sergeant Lander");
	
	//if (get_sdf() > 0) {
		//make_zone_hostile();
		//}

	last_abil = get_current_tick();
	
	set_crime_tolerance(crime_tolerance);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	// clear zone?
	//if ((zone_clear(ME) == FALSE) && (get_flag(,) > 0)) {
		//print_str_color("",2);
		//clear_zone(ME);	
		//}
		
	//if ((get_crime_level() >= crime_tolerance) && (get_sdf(,) == 0)) {
	//	make_zone_hostile();
	//	set_flag(,,1);
	//	}

	// if (gf(,) == 0) {
	//	if (get_ran(1,0,100) < 10)
	//		give_char_text_bubble(,"");
	//	}
	

		
	if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_group()) && (tick_difference(last_abil,get_current_tick()) > 2))) {
		last_abil = get_current_tick();
		
		if ((gf(63,8) == 0) && (gf(63,3) > 0)) {
			d_count = d_count + 1;
			if (d_count == 2) {
				sf(63,8,1);
				spawn_creature(8);
				set_new_abil(16,20);
				set_strategy(16,0);
				if (gf(63,3) == 1)
					begin_talk_mode(25);
					else begin_talk_mode(26);
				}
			}
		}
break;

beginstate 10;
	if (gf(63,9) == 0) {
		sf(63,9,1);
		
		activate_hidden_group(1);
		add_range_to_group(28,34,2);
		begin_talk_mode(8);
		}
break;

//	print_str("");
//	set_terrain_string_range(".",3);
//	set_terrain_string_range("The sign says - .",3);
